#pragma once

#include "../managers/gamedata_manager.h"
#include "../input/input.h"
#include <smart_ptr.h>
/**
  * Main class responsible for all program events.
  */
class GameEngine
{
public:
	GameEngine();
	void update(const int msPassed);
	void draw();
	class GameState;

private:	
	smart_ptr<GameState> cur_;
	smart_ptr<GameState> changeState(smart_ptr<GameState> newState);
	
};

/**
  * Base class for program states.
  */
class GameEngine::GameState
{
public:
	virtual void update(const int msPassed) = 0;
	virtual void draw() = 0;
	virtual ~GameState() = 0;
	GameState(GameEngine& owner);
protected:
	GameDataManager& GetGameDataManager();
	InputEngine& GetInputEngine();
private:
	GameEngine& owner_;
};
